package com.gw.ycny.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addCorsMappings(CorsRegistry registry) {

        // 允许跨域的域名，可以使用通配符"*"表示允许所有域名访问
        registry.addMapping("/**")
                .allowedOrigins("http://ycny2.dcloud.hn.dc.sgcc.com.cn");
    }
}
